import Vue from 'vue'
import VueRouter from "vue-router";
import Homepage from '@/views/Homepage'
import News from '@/views/News'
import Sports from '@/views/Sports'
import Domesticsports from '@/views/Domesticsports'
import Homesports from '@/views/Homesports'
import Sportsabroad from '@/views/Sportsabroad'
import Uirouter from '@/views/Uirouter'
import Contacts from '@/views/Contacts'
import About from '@/views/About'
import All from '@/views/All'
import Alice from '@/views/Alice'
import Bob from '@/views/Bob'
import Fax from '@/views/Fax'
import Blog from '@/views/Blog'
Vue.use(VueRouter)

const router = new VueRouter({
    routes: [
        {
            path: '/sports',
            component: Sports,
            children: [

                {
                    path: '/',
                    component: Domesticsports
                },
                {
                    path: '/homesports',
                    component: Homesports
                },
                {
                    path: '/sportsabroad',
                    component: Sportsabroad
                }
            ]
        },
        {
            path: '/homepage',
            component: Homepage
        },
        {
            path: '/news',
            component: News
        },
        //作业1
        {
            path: '*',
            component: Uirouter
        },
        {
            path: '/uirouter',
            component: Uirouter
        },
        {
            path: '/contacts',
            component: Contacts,
            children: [
                {
                    path: '/0',
                    component: All
                },
                {
                    path: '/1',
                    component: Alice
                },
                {
                    path: '/2',
                    component: Bob,
                    children: [
                        {
                            path: '/blog',
                            component: Blog
                        },
                        {
                            path: '/fax',
                            component: Fax
                        }
                    ]
                }
            ]
        },
        {
            path: '/about',
            component: About
        }
    ]
})

export default router